user defined functions tutorial for beginners